/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ocr;
import com.asprise.util.ocr.OCR;
import java.awt.image.BufferedImage;

/**
 *
 * @author Alan
 */
public class OCRReader {

    String str;

    public OCRReader(BufferedImage img){
        str = new OCR().recognizeBarcode(img);
    }

    public int getProductID(){

       try{
            return Integer.parseInt(str.substring(8));
       }catch(Exception exc){
            return 0;
       }
    }
}
